#!/usr/bin/perl
# ---------------------------------------------------------------------
# test program for modules

use strict;
use RokuUI;
use Data::Dumper;

use lib './modules';

# Logger facility
use Log::Log4perl qw(:easy);
Log::Log4perl->easy_init($DEBUG);
our $logger = get_logger();

# create the display 
my $display = RokuUI->new(host => '192.168.0.26', port => 4444);
$display->open() || debug("Couldn't connect to Roku...\n");

# ---------------------------------------------------------------------
# testing begins here

# use the module you want to test
use rss;
$logger->debug('load the module');

# Create the parameters
my %params = (rss => 'http://www.tagesschau.de/xml/rss2');

# call the module
my $object = rss->new(%params);	
$object->{display} = $display;	

$logger->debug('Starting the module');
my $rc = $object->action();		
$logger->debug("module has ended (returned $rc)");

# testing ends here
# ---------------------------------------------------------------------


END {
	# clean up
	$display->clear();
	$display->cmd("sketch -c exit");
	$display->close();
	undef $display;  
}
